package com.rp.infopub.po;

import javax.persistence.Entity;
import javax.persistence.Lob;
import javax.persistence.Table;

import org.hibernate.annotations.Type;
import org.raptor.entity.BaseModel3;

/**
 * 文章
 * @author HuangJian
 *
 */
@Entity
@Table(name="RP_INFOPUB_ARTICLES")
public class Article extends BaseModel3 {

	private static final long serialVersionUID = -5385730714817408411L;
	
	private String title;
	private String summary;			//摘要
	private String content;			//内容
	private String channelId;		//所属栏目ID
	private String channelName;		//所属栏目名称
	
	private String enabled2;		//是否激活显示
	private String creatorId;
	private String creatorName;
	private String ip;
	private Integer clickNum;		//点击量
	private String imgPath;			//标题图片相对路径
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}

	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	
	@Lob
	@Type(type="org.springframework.orm.hibernate3.support.ClobStringType")
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}

	public String getChannelId() {
		return channelId;
	}
	public void setChannelId(String channelId) {
		this.channelId = channelId;
	}
	public String getChannelName() {
		return channelName;
	}
	public void setChannelName(String channelName) {
		this.channelName = channelName;
	}
	public String getEnabled2() {
		return enabled2;
	}
	public void setEnabled2(String enabled2) {
		this.enabled2 = enabled2;
	}
	public String getCreatorId() {
		return creatorId;
	}
	public void setCreatorId(String creatorId) {
		this.creatorId = creatorId;
	}
	public String getCreatorName() {
		return creatorName;
	}
	public void setCreatorName(String creatorName) {
		this.creatorName = creatorName;
	}
	public String getIp() {
		return ip;
	}
	public void setIp(String ip) {
		this.ip = ip;
	}
	public Integer getClickNum() {
		return clickNum;
	}
	public void setClickNum(Integer clickNum) {
		this.clickNum = clickNum;
	}
	public String getImgPath() {
		return imgPath;
	}
	public void setImgPath(String imgPath) {
		this.imgPath = imgPath;
	}
	
	/**
	 * 重写equals方法
	 */
	@Override
	public boolean equals(Object obj) {
		if (obj instanceof Article) {
			Article article = (Article) obj;
			if (article.getId().equals(this.getId())) {
				return true;
			}
		}
		return false;
	}
	
}
